package com.gjy.spring.controller;

import com.gjy.spring.entity.AjaxResult;
import com.gjy.spring.properties.AppConfig;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-01-24 09:12:27
 */
@RestController
@RequestMapping("/properties")
public class PropertiesController {

    @Resource
    private AppConfig appConfig;

    @PostMapping("/app")
    public ResponseEntity<AjaxResult> app() throws Exception {
        return ResponseEntity.ok(AjaxResult.builder().data(appConfig.getName()).build());
    }

}
